package cn.robot.upload.service.impl;

import cn.robot.upload.entity.Miner;
import cn.robot.upload.mapper.MinerMapper;
import cn.robot.upload.service.IMinerService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author AC
 * @since 2020-09-29
 */
@Service
public class MinerServiceImpl extends ServiceImpl<MinerMapper, Miner> implements IMinerService {

    @Override
    public  List<String> getList() {
        LambdaQueryWrapper<Miner> lambdaQueryWrapper = Wrappers.<Miner>lambdaQuery().eq(Miner::getStatus, 1);
        List<Miner> list = list(lambdaQueryWrapper);
        List<String> strList = new ArrayList<>();
        list.forEach(miner -> strList.add(miner.getMiner()));
        return strList;
    }
}
